// 教师管理模块mock数据
import { MockMethod } from 'vite-plugin-mock';
// resultSuccess, resultPageSuccess
import { resultSuccess } from '../_util';

const classListApi = (() => {
  const result: any[] = [];
  for (let index = 0; index < 4; index++) {
    result.push({
      title: `${'@cname'} + 班`,
      icon: 'carbon:logo-github',
      color: '',
      desc: '不要等待机会，而要创造机会。',
      group: '开源组',
      date: '2021-04-01',
      id: index + 1,
      total: 58,
    });
  }
  return result;
})();

const classDetailApi = (() => {
  const result: any = {
    className: '@cname',
    master: '蒲老师',
    students: [],
  };
  for (let index = 0; index < 58; index++) {
    result.students.push({
      name: '@cname',
      sex: '男',
      idcard: '@natural',
      'score|1-100': 1,
      'status|1': ['正常', '启用', '停用'],
    });
  }
  return result;
})();

export default [
  {
    url: '/basic-api/classList',
    timeout: 1000,
    method: 'get',
    // response: () => {
    //   return resultPageSuccess(shopList);
    // },
    response: () => {
      // const { page, pageSize } = query;
      return resultSuccess(classListApi);
    },
  },
  {
    url: '/basic-api/classDetail',
    timeout: 1000,
    method: 'get',
    // response: () => {
    //   return resultPageSuccess(shopList);
    // },
    response: () => {
      // const { page, pageSize } = query;
      return resultSuccess(classDetailApi);
    },
  },
] as MockMethod[];
